﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data.SqlClient;

namespace FYPHP
{
    public partial class SelectPayment : System.Web.UI.Page
    {
        SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["fyphp"].ConnectionString);

        protected void Page_Load(object sender, EventArgs e)
        {
            SqlCommand cmdSeller;
            SqlDataReader dtrSeller;

            String ReferenceNumber = Session["ReferenceNumber"].ToString();
            String TotalOrder = Session["TotalOrder"].ToString();
            String SellerID = Session["SellerID"].ToString();
            String SellerAccount="";

            conn.Open();

            cmdSeller = new SqlCommand("SELECT * FROM Users where u_id=@id", conn);
            cmdSeller.Parameters.AddWithValue("@id", SellerID);
            dtrSeller = cmdSeller.ExecuteReader();

            dtrSeller.Read();

            SellerAccount = dtrSeller["u_email"].ToString();

            dtrSeller.Close();
            conn.Close();

            Response.Write("email " + SellerAccount + "-----Reference Number:" + ReferenceNumber + "----Amount" + TotalOrder);

            Label4.Text = "  <input type='hidden' name='business' value='" + SellerAccount + "' /><input type='hidden' name='item_name' value='" + ReferenceNumber + "' /><input type='hidden' name='amount' value='" + TotalOrder + "'  /> ";

           

        }
    }
}